<?php

  //to do: improve the way to pass two or more parameters in the paged-table ( link )

  $aux = explode ( '|', $_GET['id'] );
  $index=0;
  $AssignmentareaUid = str_replace ( '"', '', $aux[$index++] );

  require_once ( PATH_PLUGINS . 'hr' . PATH_SEP . 'class.hr.php');
  $pluginObj = new hrClass ();

  require_once ( "classes/model/HrAssignmentareas.php" );
  //if exists the row in the database propel will update it, otherwise will insert.
  $tr = HrAssignmentareasPeer::retrieveByPK( $AssignmentareaUid  );

  if ( ( is_object ( $tr ) &&  get_class ($tr) == 'HrAssignmentareas' ) ) { 
     $fields['ASSIGNMENTAREA_UID'] = $tr->getAssignmentareaUid();
     $fields['LABEL_ASSIGNMENTAREA_UID'] = $tr->getAssignmentareaUid();
     $fields['ASSIGNMENTAREA'] = $tr->getAssignmentarea();
     $fields['LABEL_ASSIGNMENTAREA'] = $tr->getAssignmentarea();
     $fields['ASSIGNMENTAREADESCRIPTION'] = $tr->getAssignmentareadescription();
     $fields['LABEL_ASSIGNMENTAREADESCRIPTION'] = $tr->getAssignmentareadescription();
  }
  else
    $fields = array();

  $G_MAIN_MENU = 'workflow';
  $G_SUB_MENU = 'hrAssignmentareas';
  $G_ID_MENU_SELECTED = '';
  $G_ID_SUB_MENU_SELECTED = '';


  $G_PUBLISH = new Publisher;
  $G_PUBLISH->AddContent('xmlform', 'xmlform', 'hr/hrAssignmentareasDelete', '', $fields, 'hrAssignmentareasDeleteExec' );
  G::RenderPage('publish', 'blank');
?>